<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <link rel="stylesheet" href="./node_modules/animate.css/animate.css">
    <style>
        div{
            display: inline-block;
        }
        .green {
            width: 200px;
            height: 200px;
            background: green;
        }

        .red {
            width: 200px;
            height: 200px;
            background: red;
        }
    </style>
</head>

<body>
    <!-- 定义挂载点 -->
    <div id="app">
        <button @click="isShow = !isShow">切换</button>
        <transition enter-active-class="animate__animated animate__fadeInLeft">
            <div class="green" v-if="isShow">green</div>
        </transition>
        <transition enter-active-class="animate__animated animate__fadeInLeft">
            <div class="red" v-if="!isShow">red</div>
        </transition>
    </div>

    <script>
        new Vue({
            //挂载点
            el: "#app",
            //数据
            data: {
                isShow: true
            },
            //方法
            methods: {}
        })
    </script>
</body>

</html>